using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;

namespace uTorrentNetClient.ModelDesign.Converter
{
    [ValueConversion(typeof(long), typeof(string))]
    public class SizeBytesShowZeroDisplayConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (targetType != typeof(string))
            {
                return null;
            }
            if (value is long)
            {
                long SizeToConvert = (long)value;
                return Utilities.FormatFileSize(SizeToConvert, true, "B");
            }
            return null;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
